package org.jflame.context.filemanager;

import org.jflame.commons.config.ConfigReader;

import java.nio.file.Path;
import java.nio.file.Paths;

/**
 * 文件管理配置属性基类
 *
 * @author charles.zhang
 */
public class FileManagerCfg {

    public final static String JFLAME_FILE_CFG_PREFIX = ConfigReader.JFLAME_CFG_KEY_PREFIX + ".file";
    public final static String JFLAME_FILE_CFG_TYPE = JFLAME_FILE_CFG_PREFIX + ".client-type";

    /**
     * 文件上传保存的基础路径
     */
    private String savePath;
    /**
     * 文件对外访问地址
     */
    private String server;

    public FileManagerCfg() {
    }

    public FileManagerCfg(String savePath, String server) {
        this.savePath = savePath;
        this.server = server;
    }

    public String getSavePath() {
        return savePath;
    }

    public void setSavePath(String savePath) {
        this.savePath = savePath;
    }

    public String getServer() {
        return server;
    }

    public void setServer(String server) {
        this.server = server;
    }

    public Path savePath() {
        return Paths.get(savePath);
    }

}
